﻿@using OSBIDE.Library.Events
@using OSBIDE.Web.Models.Queries
@model OSBIDE.Web.Models.AggregateFeedItem  
@{
    LogCommentEvent comment = Model.Items.First().Event as LogCommentEvent;
    Model.Items.First().LogId = comment.SourceEventLogId;
    IOsbideEvent evt = EventFactory.FromName(comment.SourceEventLog.LogType);
} 
@Model.Creator.FirstName commented on
@if (Model.Creator.Id == comment.SourceEventLog.SenderId)
{
    switch(Model.Creator.Gender)
    {
        case OSBIDE.Library.Models.Gender.Female:
            @:her own
            break;
            
        case OSBIDE.Library.Models.Gender.Male:
            @:his own
            break;
            
        case OSBIDE.Library.Models.Gender.Unknown:
            @:their own
            break;
    }
}
else
{
    //anonymize IDE events
    bool isIdeEvent = ActivityFeedQuery.GetIdeEvents().Where(e => e.EventName.CompareTo(comment.SourceEventLog.LogType) == 0).Count() > 0;
    if(isIdeEvent)
    {
        <text>a student's</text>
    }
    else
    {
        <text>@string.Format("{0}'s", comment.SourceEventLog.Sender.FirstName)</text>   
    }
}
@string.Format("{0}:", evt.PrettyName.ToLower())
<br />
@comment.Content